package com.larry.flume.source;

import org.apache.flume.Context;
import org.apache.flume.EventDeliveryException;
import org.apache.flume.PollableSource;
import org.apache.flume.conf.Configurable;
import org.apache.flume.source.AbstractSource;

/**
 * @ProjectName hadoop
 * @Author larry
 * @Date 17:13 2021/11/30
 * @Description 自定义source
 **/
public class MySource extends AbstractSource implements Configurable, PollableSource {

    /**
     * source核心处理方法
     * 循环调用
     * @return
     * @throws EventDeliveryException
     */
    @Override
    public Status process() throws EventDeliveryException {
        return null;
    }

    /**
     * 规避时间的增长间隔
     * @return
     */
    @Override
    public long getBackOffSleepIncrement() {
        return 1;
    }

    /**
     * 最大规避时间间隔
     * @return
     */
    @Override
    public long getMaxBackOffSleepInterval() {
        return 10;
    }

    /**
     * 读取配置信息
     * @param context
     */
    @Override
    public void configure(Context context) {

    }
}
